package com.internetCafes.spms.web.customer.common.cont;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 企业区域相关内容
 */
public class AreaConst {

    /**
     * 单位永久
     */
    public static final String EFFECTIVE_ALWAYS = "永久";

    /**
     * 管理/负责时间单位
     */
    public static final String MANAGE_TIME_UNIT = "天";

    /**
     * 获取区域列表数据
     * 使用场景id
     */
    public enum AreaListAction {
        DISTRIBUTE(1, "分配")
        ;

        /**
         * id
         */
        private Integer id;

        /**
         * 使用场景
         */
        private String action;

        AreaListAction(Integer id, String action) {
            this.id = id;
            this.action = action;
        }

        public Integer getId() {
            return id;
        }

        public String getAction() {
            return action;
        }
    }

    /**
     * 获取区域树形数据
     * 使用场景id
     */
    public enum AreaTreeAction {

        ALL(1, "所有"),
        USER_DISTRIBUTE(2, "根据分配的区域"),

        ;

        /**
         * id
         */
        private Integer id;

        /**
         * 使用场景
         */
        private String action;

        AreaTreeAction(Integer id, String action) {
            this.id = id;
            this.action = action;
        }

        public Integer getId() {
            return id;
        }

        public String getAction() {
            return action;
        }
    }

    /**
     * 1-区域角度 2-销售角度
     */
    public enum EntAreaExportTypeEnum{
        AREA_USER(1, "区域角度"),
        USER_AREA(2, "销售角度"),
        ;
        /**
         * id
         */
        private Integer id;

        /**
         * 类型
         */
        private String type;

        EntAreaExportTypeEnum(Integer id, String type) {
            this.id = id;
            this.type = type;
        }

        public Integer getId() {
            return id;
        }

        public String getType() {
            return type;
        }
    }

    /**
     * 区域分配类型
     */
    public enum AreaUserConfigTypeEnum{

        MANAGER(1, "管理人"),
        SALE(2, "负责人"),
        TOGETHER(3, "一起分配")
        ;
        /**
         * id
         */
        private Integer id;

        /**
         * 类型
         */
        private String type;

        AreaUserConfigTypeEnum(Integer id, String type) {
            this.id = id;
            this.type = type;
        }

        public Integer getId() {
            return id;
        }

        public String getType() {
            return type;
        }

        public static List<Integer> getTypeIdList() {
            return Arrays.stream(values()).map(AreaUserConfigTypeEnum::getId).collect(Collectors.toList());
        }
    }

    /**
     * 区域类型
     */
    public enum AreaTypeEnum{

        PROVINCE(1, "省"),
        CITY(2, "市"),
        AREA(3, "区"),
        ;

        /**
         * id
         */
        private Integer id;

        /**
         * 类型
         */
        private String type;

        AreaTypeEnum(Integer id, String type) {
            this.id = id;
            this.type = type;
        }

        public Integer getId() {
            return id;
        }

        public String getType() {
            return type;
        }

        public static List<Integer> getAreaTypeIdList() {
            return Arrays.stream(values()).map(AreaTypeEnum::getId).collect(Collectors.toList());
        }
    }
}
